package com.example.jianyijisuanqi;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

public class MySQLiteHelper extends SQLiteOpenHelper {
    private static final String DATABASE_NAME = "SQLite.db";
    private static final int DATABASE_VERSION = 1;
    private static final String TABLE_NAME = "history";

    public MySQLiteHelper (Context context) {
        super (context, DATABASE_NAME, null, DATABASE_VERSION);
    }

    @Override
    public void onCreate (SQLiteDatabase db) {
        db.execSQL("create table " + "if not exists " + TABLE_NAME + "(" + "first varchar , " + "second varchar, "
                + "third varchar, " + "forth varchar, " + "result integer)");
    }

    @Override
    public void onUpgrade (SQLiteDatabase db, int oldVersion, int newVersion) {
        db.execSQL ("drop table if exists " + TABLE_NAME);
        this.onCreate(db);
    }
}
